package com.tbit.uqbike.object.pojo;

import lombok.Data;
import lombok.ToString;

import java.util.Map;

@Data
@ToString
public class ExeRet {
    /**
     * 升级成功
     */
    private Integer succ;
    /**
     * 更新超时
     */
    private Integer upto;
    /**
     * 下载超时
     */
    private Integer dto;
    /**
     * 下载完成
     */
    private Integer dover;
    /**
     * 下载中
     */
    private Integer ding;
    /**
     * 已通知
     */
    private Integer notice;
    /**
     * 未升级（初始状态）
     */
    private Integer init;
    /**
     * 总数
     */
    private Integer total;

    public ExeRet(Map<Object, Long> taskMap) {
        if (taskMap.get("succ") == null) {
            this.succ = 0;
        } else {
            this.succ = Integer.parseInt(taskMap.get("succ").toString());
        }
        if (taskMap.get("upto") == null) {
            this.upto = 0;
        } else {
            this.upto = Integer.parseInt(taskMap.get("upto").toString());
        }
        if (taskMap.get("dover") == null) {
            this.dover = 0;
        } else {
            this.dover = Integer.parseInt(taskMap.get("dover").toString());
        }
        if (taskMap.get("dto") == null) {
            this.dto = 0;
        } else {
            this.dto = Integer.parseInt(taskMap.get("dto").toString());
        }
        if (taskMap.get("ding") == null) {
            this.ding = 0;
        } else {
            this.ding = Integer.parseInt(taskMap.get("ding").toString());
        }
        if (taskMap.get("notice") == null) {
            this.notice = 0;
        } else {
            this.notice = Integer.parseInt(taskMap.get("notice").toString());
        }
        if (taskMap.get("init") == null) {
            this.init = 0;
        } else {
            this.init = Integer.parseInt(taskMap.get("init").toString());
        }
        if (taskMap.get("total") == null) {
            this.total = 0;
        } else {
            this.total = Integer.parseInt(taskMap.get("total").toString());
        }
    }

}
